#include "volumeManager.h"

bool volumeManager::addRawVolume(char* volumeName, char* filename, int z, int y, int x, int voxelByteSize)
{
	volume3D* vol = new volume3D(filename, z, y, z, voxelByteSize);
	_volumeTable.insert(std::pair<std::string, volume3D*>(std::string(volumeName), vol));

	return true;
}

bool volumeManager::getDataByName(char* volumeName, void*& buffer, int &z, int &y, int &x, int &voxelByteSize)
{
	std::map<std::string, volume3D*>::iterator iter = _volumeTable.begin();
	iter = _volumeTable.find(std::string(volumeName));
	x = iter->second->getDimX();
	y = iter->second->getDimY();
	z = iter->second->getDimZ();
	voxelByteSize = iter->second->getVoxelByteSize();
	buffer = iter->second->getDataBuffer();

	return true;
}
